package cn.iocoder.yudao.module.crossborder.platform.controller.admin.platformauth.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;

@Schema(description = "管理后台 - 跨境电商平台授权信息新增/修改 Request VO")
@Data
public class PlatformAuthSaveReqVO {

    @Schema(description = "授权编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "22769")
    private Long id;

    @Schema(description = "平台编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "29235")
    @NotNull(message = "平台编号不能为空")
    private Long platformId;

    @Schema(description = "店铺编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "5137")
    @NotNull(message = "店铺编号不能为空")
    private Long storeId;

    @Schema(description = "认证类型（1OAuth2 2API密钥 3JWT 4Basic Auth）", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "认证类型（1OAuth2 2API密钥 3JWT 4Basic Auth）不能为空")
    private Integer authType;

    @Schema(description = "客户端ID", example = "28136")
    private String clientId;

    @Schema(description = "客户端密钥")
    private String clientSecret;

    @Schema(description = "访问令牌")
    private String accessToken;

    @Schema(description = "刷新令牌")
    private String refreshToken;

    @Schema(description = "令牌类型", example = "1")
    private String tokenType;

    @Schema(description = "授权范围")
    private String scope;

    @Schema(description = "令牌有效期（秒）")
    private Integer expiresIn;

    @Schema(description = "令牌过期时间")
    private LocalDateTime tokenExpireTime;

    @Schema(description = "API密钥")
    private String apiKey;

    @Schema(description = "API密钥")
    private String apiSecret;

    @Schema(description = "额外参数JSON")
    private String additionalParams;

    @Schema(description = "授权状态（0未授权 1已授权 2授权过期 3授权失败）", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "授权状态（0未授权 1已授权 2授权过期 3授权失败）不能为空")
    private Integer authStatus;

    @Schema(description = "授权时间")
    private LocalDateTime authTime;

    @Schema(description = "最后刷新时间")
    private LocalDateTime lastRefreshTime;

    @Schema(description = "授权错误信息")
    private String authErrorMsg;

    @Schema(description = "是否自动刷新令牌", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "是否自动刷新令牌不能为空")
    private Boolean autoRefresh;

}